-- GENERATED SPELL FOR [Archmage Ansirem Runeweaver] --


function spell0_2543(pUnit, Event) --@Chains of Ice,n/a--
pUnit:FullCastSpellOnTarget(512,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2543', 21300, 1)
end

function spell1_2543(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(20792,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2543', 7000, 1)
end

function spell2_2543(pUnit, Event) --@Mage Sight,Self--
pUnit:FullCastSpellOnTarget(3659,pUnit)
pUnit:RegisterEvent('Sorts_2543', 3000, 1)
end

function spell3_2543(pUnit, Event) --@Polymorph,n/a--
pUnit:FullCastSpellOnTarget(118,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2543', 21500, 1)
end

function Sorts_2543(pUnit, Event)
local choix_sorts_2543 = math.random(0, 3)
if choix_sorts_2543 == 0 then
pUnit:RegisterEvent('spell0_2543', 1, 1)
end
if choix_sorts_2543 == 1 then
pUnit:RegisterEvent('spell1_2543', 1, 1)
end
if choix_sorts_2543 == 2 then
pUnit:RegisterEvent('spell2_2543', 1, 1)
end
if choix_sorts_2543 == 3 then
pUnit:RegisterEvent('spell3_2543', 1, 1)
end
end

function mob2543_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2543', math.random(1500, 3000), 1)
end

function mob2543_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2543_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2543_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2543, 1, 'mob2543_Action')
RegisterUnitEvent(2543, 2, 'mob2543_Leave')
RegisterUnitEvent(2543, 3, 'mob2543_Kill')
RegisterUnitEvent(2543, 4, 'mob2543_Die')
